
// This script returns all folders that DO NOT contain a specific 
// file.
	
var objFSO = new ActiveXObject( "Scripting.FileSystemObject" );
var regExp = new RegExp( SearchParms.FilenameCustomParm, "i" );

function isValidFileName( strPath, strFileName )
{
	// Open the folder and see if there are any files which do NOT match the given regular expression
	
	var bIsValid = true;
	try
	{
		
		var strFolderPath = strPath + strFileName
		if ( objFSO.FolderExists( strFolderPath ) )
		{
			var folderCheck = objFSO.GetFolder( strFolderPath );
			var fc = new Enumerator(folderCheck.files);

			for (; !fc.atEnd(); fc.moveNext())
			{
				if ( regExp.test( fc.item() ) )
					return false;
			}
		}
	}
	catch( e )	{
		bIsValid = false;
	}
	return bIsValid;
}